package com.abel.cloud.hystrix.service.impl;

import com.abel.cloud.common.po.UserAccountPO;
import com.abel.cloud.common.response.Resp;
import com.abel.cloud.hystrix.service.UserAccountService;
import org.springframework.stereotype.Component;

/**
 * Author: Abel.lin
 * Date: 2021/5/7 16:43
 * Company: Abel Studio
 * Copyright: Copyright (c) 2017
 * Description:
 */
@Component
public class UserAccountFallBackService implements UserAccountService {
    @Override
    public Resp<UserAccountPO> getUser(Integer id) {
        return Resp.failed(String.format("method[%s]调用失败，服务被降级", Thread.currentThread() .getStackTrace()[1].getMethodName()));
    }

    @Override
    public Resp timeOut(Integer sec) {
        return Resp.failed(String.format("method[%s]调用失败，服务被降级", Thread.currentThread() .getStackTrace()[1].getMethodName()));
    }
}
